using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;

namespace Scurvy.Media.Pipeline
{
    /// <summary>
    /// Holds the data to stream in memory
    /// </summary>
    public class VideoStreamContent : IDisposable
    {
        //private MemoryStream _stream;
        private List<Texture2DContent> _frames;
        int _count;
        double _frameRate;
        Vector2 _size;

        public VideoStreamContent(List<Texture2DContent> frames,
            //MemoryStream stream, 
            int count, double frameRate, Vector2 size)
        {
            //_stream = stream;
            _frames = frames;
            _count = count;
            _frameRate = frameRate;
            _size = size;
        }

        public int Count
        {
            get { return _count; }
        }

        public double FrameRate
        {
            get { return _frameRate; }
        }

        public Vector2 Size
        {
            get { return _size; }
        }

        public List<Texture2DContent> Frames
        {
            get { return _frames; }
        }

        //internal byte[] ToByteArray()
        //{
        //    return _stream.ToArray();
        //}

        #region IDisposable Members

        public void Dispose()
        {
            _frames.Clear();
            _frames = null;

            //_stream.Close();
            //_stream.Dispose();
            //_stream = null;
        }

        #endregion
    }
}
